package com.atqinke.designpattern.behavioraltype.iterator;

import java.util.ArrayList;

/**
 * @BelongsProject: BasicConnection
 * @BelongsPackage: com.atqinke.designpattern.behavioraltype.iterator
 * @Author: NieHk
 * @CreateTime: 2022-08-29  15:50
 * @Description:
 * @Version: 1.0
 */
public class test {
    public static void main(String[] args) {
        ArrayList<Object> list = new ArrayList<>();
        list.add("张三");
        list.add("李四");
        list.add("王五");
        list.add("赵六");
        IteratorContainer container = new IteratorContainerImpl(list);
        ObjectIterator iterator = container.getIterator();
        while (iterator.hasNext()){
            Object o = iterator.next();
            System.out.println(o);
        }
    }
}
